<h2 class="panel-title">{{"funds.withdraw_fiat.title" | t:currencyTranslationLocals}}</h2>
  <div class="help-block">
    {{"funds.withdraw_fiat.intro" | t}} <br />
    {{"funds.withdraw_fiat.intro_2" | t}} <br />
    <span class="text-danger"><strong>{{"funds.withdraw_fiat.attention" | t}}</strong> </span>
  </div>

  <div class="border p-3 my-3">
  <form name="withdraw_form" class="form form-horizontal" ng-controller="WithdrawsController as withdrawsCtrl" ng-submit="withdrawsCtrl.createWithdraw(currency)">
    <div class="form-group row">
      <div class="col-sm-3">
        <label class="optional control-label">{{"funds.withdraw_fiat.balance" | t}}</label>
      </div>
      <div class="col-sm-9">
        <p class="form-control-static"><span class="currency-balance" id="withdraw_balance">{{balance}}</span></p>
      </div>
    </div>

    <div class="form-group row required">
      <div class="col-sm-3">
        <label class="required control-label" for="withdraw_rid">Withdraw RID</label>
      </div>
      <div class="col-sm-9">
        <input class="required form-control" id="withdraw_rid" name="withdraw[rid]" placeholder="Recipient ID" type="text" ng-model="withdrawsCtrl.withdraw.rid">
      </div>
    </div>

    <div class="form-group row required">
      <div class="col-sm-3">
        <label class="decimal required control-label" for="withdraw_sum">Withdraw amount</label>
      </div>
      <div class="col-sm-9">
        <div class="input-group">
          <input class="numeric decimal required form-control" id="withdraw_sum" name="withdraw[sum]" placeholder="{{'funds.withdraw_fiat.min' | t}} 100" type="text" value="0.0" ng-model="withdrawsCtrl.withdraw.sum">
          <div class="input-group-btn"><button ng-click="withdrawsCtrl.withdrawAll()" class="btn btn-success" id="withdraw_all_btn" type="button">{{"funds.withdraw_fiat.withdraw_all" | t}}</button></div>
        </div>
      </div>
    </div>

    <div class="form-group">
      <div class="form-submit">
        <input  id="withdraw_submit" class="btn btn-primary" data-loading-text="Creating..." name="commit" type="submit" value='{{ "submit" | t }}'>
      </div>
    </div>
  </form>
  </div>

  <br>
  <h2 class="panel-title">{{ "funds.withdraw_history.title" | t }}</h2>

  <table class="table withdraw-history" ng-controller="WithdrawHistoryController as wdCtrl">
    <tr>
      <th>{{ "funds.withdraw_history.number" | t }}</th>
      <th>{{ "funds.withdraw_history.withdraw_time" | t }}</th>
      <th>{{ "funds.withdraw_history.withdraw_account" | t }}</th>
      <th>{{ "funds.withdraw_history.withdraw_amount" | t }}</th>
      <th>{{ "funds.withdraw_history.fee" | t }}</th>
      <th>{{ "funds.withdraw_history.state_and_action" | t }}</th>
    </tr>
    <tr ng-repeat="withdraw in wdCtrl.withdraws | orderBy:predicate">
      <td>{{withdraw.id}}</td>
      <td>{{withdraw.created_at | date:'yyyy-MM-dd HH:mm'}}</td>
      <td>{{withdraw.rid}}</td>
      <td>{{withdraw.amount}}</td>
      <td>{{withdraw.fee}}</td>
      <td>{{"funds.withdraw_history." + withdraw.aasm_state | t}}
        <span ng-if="wdCtrl.canCancel(withdraw.aasm_state)">/
          <a ng-click="wdCtrl.cancelWithdraw(withdraw); $event.preventDefault()" href="#" class="cancel_link">{{ "funds.withdraw_history.cancel" | t }}</a>
        </span>
      </td>
    </tr>
    <tr ng-if="wdCtrl.noWithdraw()"><td colspan="6"><span class="help-block text-center">{{"funds.withdraw_history.no_data" | t}}</span></td></tr>
  </table>

